package com.xyf.test;

import java.util.ArrayList;

public class Psvm {
    public static void main(String[] args) {

        ArrayList<Person> arrryList = new ArrayList<>();
        arrryList.add(new Person(10,"1"));
        arrryList.add(new Person(11,"2"));
        arrryList.add(new Person(13,"3"));
        arrryList.add(new Person(14,"4"));

        arrryList.sort((o1, o2) -> o2.age-o1.age);
        System.out.println(arrryList);

    }
}
